package com.foreknow.elm.dao;

import com.foreknow.elm.po.Delivery;

import java.util.List;

/**
 * @author 啊滨
 * @date 2023/2/14 14:14
 */
public interface DeliveryDao {
    /**
     * 根据用户编号查询所属送货地址
     * @param userId
     * @return
     * @throws Exception
     */
    public List<Delivery> listDeliveryAddressByUserId(String userId)throws  Exception;

    /**
     * 根据送货地址编号查询送货地址
     * @param daId
     * @return
     * @throws Exception
     */
    public Delivery getDeliveryAddressById(Integer daId) throws Exception;

    /**
     * 向送货地址表中添加一条记录
     * @param contactName
     * @param contactSex
     * @param contactTel
     * @param address
     * @param userId
     * @return
     * @throws Exception
     */
    public int saveDeliveryAddress(String contactName,Integer contactSex,String contactTel,String address,String userId)throws Exception;

    /**
     * 根据送货地址编号更新送货地址信息
     * @param daId
     * @param contactName
     * @param contactSex
     * @param contactTel
     * @param address
     * @param userId
     * @return
     * @throws Exception
     */
    public int updateDeliveryAddress(Integer daId, String contactName,Integer contactSex,String contactTel,String address,String userId)throws Exception;

    /**
     * 根据送货地址编号删除一条记录
     * @param daId
     * @return
     * @throws Exception
     */
    public  int removeDeliveryAddress(Integer daId)throws  Exception;

}
